package com.xjc.system.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.xjc.business.entity.domain.xlsx.StuImportEntity;

import java.util.ArrayList;
import java.util.List;

public class UserDataListener implements ReadListener<StuImportEntity> {

    private final List<StuImportEntity> dataList = new ArrayList<>();

    @Override
    public void invoke(StuImportEntity userData, AnalysisContext context) {
        dataList.add(userData);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        System.out.println("所有数据读取完成");
    }

    public List<StuImportEntity> getDataList() {
        return dataList;
    }
}